package com.coollang.smartbra.activity;

import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.coollang.smartbra.MyAutoLayoutActivity;
import com.coollang.smartbra.R;
import com.coollang.smartbra.utils.ActivitySwitcher;
import com.coollang.smartbra.utils.PackageUtils;
import com.coollang.smartbra.utils.TranslucentSystemBarUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author: Timmy
 * @Data: 2017/9/1
 * @Fuction: 关于我们页面
 */
public class AboutTeamActivity extends MyAutoLayoutActivity {

    @BindView(R.id.status_bar)
    View mStatusBar;
    @BindView(R.id.content)
    LinearLayout mContent;
    @BindView(R.id.tv_title)
    TextView mTvTitle;
    @BindView(R.id.tv_version)
    TextView mTvVersion;
    @BindView(R.id.rl_service_regulations)
    RelativeLayout mRlServiceRegulations;
    @BindView(R.id.rl_privacy_policy)
    RelativeLayout mRlPrivacyPolicy;

    @Override
    protected void initView() {
        setContentView(R.layout.activity_about_team);
        ButterKnife.bind(this);
        TranslucentSystemBarUtils.showChenJinZhuangTaiLan(mStatusBar, this, mContent);
        initViews();

    }

    private void initViews() {
        mTvTitle.setText(getString(R.string.about_app));
        mTvTitle.setTextColor(ContextCompat.getColor(this, R.color.black_666));
        mTvVersion.setText(getString(R.string.app_name) + "：" + PackageUtils.getAppVersionName());

    }

    @OnClick({R.id.rl_service_regulations, R.id.rl_privacy_policy, R.id.iv_back})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rl_service_regulations:
                ActivitySwitcher.goToWebViewActivity(this, 1);
                break;
            case R.id.rl_privacy_policy:
                ActivitySwitcher.goToWebViewActivity(this, 2);
                break;
            case R.id.iv_back:
                finish();
                break;
            default:
                break;
        }
    }

}
